package com.zhongfl.crm.service.impl;

import com.github.pagehelper.PageHelper;
import com.zhongfl.crm.mapper.LxDeliverOrderMapper;
import com.zhongfl.crm.model.LxChannel;
import com.zhongfl.crm.model.LxCustomerOrder;
import com.zhongfl.crm.model.LxDeliverOrder;
import com.zhongfl.crm.request.LxChannelRequest;
import com.zhongfl.crm.request.LxDeliverOrderRequest;
import com.zhongfl.crm.service.LxDeliverOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 交付订单 服务实现类
 *
 * @author 奈良鹿丸
 * @date 2018/9/21
 */
@Service
public class LxDeliverOrderServiceImpl implements LxDeliverOrderService {

    @Resource
    private LxDeliverOrderMapper lxDeliverOrderMapper;

    /**
     * 按照客户订单ID查询对应的交付订单列表业务
     *
     * @param lxCustomerOrderId 励销客户订单ID
     * @return 励销交付订单对象列表
     */
    @Override
    public List<LxDeliverOrder> findLxDeliverOrderByLxCustomerId(Long lxCustomerOrderId) {
        return lxDeliverOrderMapper.selectLxDeliverOrderByLxCustomerId(lxCustomerOrderId);
    }

    /**
     * 分页查询所有交付订单数据
     * @param lxDeliverOrderRequest
     * @return
     */
    @Override
    public List<LxDeliverOrder> findLxDeliverOrderByPage(LxDeliverOrderRequest lxDeliverOrderRequest) {
        PageHelper.startPage(lxDeliverOrderRequest.getPage(),lxDeliverOrderRequest.getPageSize());
        return lxDeliverOrderMapper.findLxDeliverOrderByPage(lxDeliverOrderRequest);
    }

    /**
     * 按id查询交付订单详情
     * @param id
     * @return
     */
    @Override
    public LxDeliverOrder findLxDeliverOrderById(Long id) {
        return lxDeliverOrderMapper.findLxDeliverOrderById(id);
    }

    /**
     * 按渠道id查询对应的交付订单
     * @param lxDeliverOrderRequest
     * @return
     */
    @Override
    public List<LxDeliverOrder> findLxDeliverOrderByCustomerId(LxDeliverOrderRequest lxDeliverOrderRequest) {
        PageHelper.startPage(lxDeliverOrderRequest.getPage(),lxDeliverOrderRequest.getPageSize());
        return lxDeliverOrderMapper.findLxDeliverOrderByCustomerId(lxDeliverOrderRequest);
    }

//    /**
//     * 按客户id查询对应的交付订单
//     * @param lxDeliverOrderRequest
//     * @return
//     */
//    @Override
//    public List<LxDeliverOrder> findLxDeliverOrderByCustomerIds(LxDeliverOrderRequest lxDeliverOrderRequest) {
//        PageHelper.startPage(lxDeliverOrderRequest.getPage(),lxDeliverOrderRequest.getPageSize());
//        return lxDeliverOrderMapper.findLxDeliverOrderByCustomerIds(lxDeliverOrderRequest);
//    }
}
